/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qinyeit.serviceapp.entity.enums.InventoryState;
import com.qinyeit.serviceapp.entity.enums.InventoryType;
import com.qinyeit.serviceapp.entity.enums.NotMode;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * ClassName: InventoryOrder <br/>
 * Function: 盘点单据 <br/>
 * date: 2018-11-08 11:29:40 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="inventory_orders")
public class InventoryOrder extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 单号 
    @Column(name="no", length = 300)
	private String no = null;

	// 盘点仓库 
    @Column(name="warehouse_id")
	private Long warehouseId = null;

	// 盘点仓库
	@Column(name="warehouse_name")
	private String warehouseName = null;

	// 盘点类型 
    @Column(name="type", length = 300)
	@Enumerated(EnumType.STRING)
	private InventoryType type = null;

	// 未盘点处理 
    @Column(name="not_mode", length = 300)
	@Enumerated(EnumType.STRING)
	private NotMode notMode = null;

	// 状态 
    @Column(name="state", length = 300)
	@Enumerated(EnumType.STRING)
	private InventoryState state = null;

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "audit_time")
	private Date auditTime;


	// 菜品库
	@Column(name="store_id", length = 300)
	private Long storeId = null;

	// 菜品库
	@Column(name="store_name", length = 300)
	private String storeName = null;

    @Tolerate
	public InventoryOrder() {
		
	}
    @Tolerate
	public InventoryOrder(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取单号
	 */
	public String getNo() {
		return this.no;
	}

    /**
     * 设置单号
     */
	public InventoryOrder setNo(String no) {
		this.no = no;
		return this;
	}

	/**
	 * 获取盘点仓库
	 */
	public Long getWarehouseId() {
		return this.warehouseId;
	}

    /**
     * 设置盘点仓库
     */
	public InventoryOrder setWarehouseId(Long warehouseId) {
		this.warehouseId = warehouseId;
		return this;
	}

	public InventoryType getType() {
		return type;
	}

	public void setType(InventoryType type) {
		this.type = type;
	}

	public NotMode getNotMode() {
		return notMode;
	}

	public void setNotMode(NotMode notMode) {
		this.notMode = notMode;
	}

	public InventoryState getState() {
		return state;
	}

	public void setState(InventoryState state) {
		this.state = state;
	}

	public String getWarehouseName() {
		return warehouseName;
	}

	public void setWarehouseName(String warehouseName) {
		this.warehouseName = warehouseName;
	}

	public Date getAuditTime() {
		return auditTime;
	}

	public void setAuditTime(Date auditTime) {
		this.auditTime = auditTime;
	}

	public Long getStoreId() {
		return storeId;
	}

	public void setStoreId(Long storeId) {
		this.storeId = storeId;
	}

	public String getStoreName() {
		return storeName;
	}

	public void setStoreName(String storeName) {
		this.storeName = storeName;
	}
}
